// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatement;
// import com.alibaba.druid.sql.ast.statement.SQLIfStatement;
// import com.alibaba.druid.sql.dialect.mysql.ast.MySqlObjectImpl;
// import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlStatementImpl;
// import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

// import java.util.ArrayList;
// import java.util.List;
#pragma once
#include "../MySqlObjectImpl.h"
#include "../statement/MySqlStatementImpl.h"

class MySqlCaseStatement_MySqlWhenStatement : virtual public MySqlObjectImpl
{
public:
  SQLExpr_ptr condition;
  SQLStatement_list_ptr statements;
  MySqlCaseStatement_MySqlWhenStatement();
  SHAREDOBJECT(MySqlCaseStatement_MySqlWhenStatement);
  // @Override
  void accept0(MySqlASTVisitor_ptr visitor);

  SQLExpr_ptr getCondition();

  void setCondition(SQLExpr_ptr condition);

  SQLStatement_list_ptr getStatements();

  void setStatements(SQLStatement_list_ptr statements);
};

class MySqlCaseStatement : virtual public MySqlStatementImpl
{
public:
  // case expr
  SQLExpr_ptr condition;
  // when statement list
  MySqlCaseStatement_MySqlWhenStatement_list_ptr whenList;
  // else statement
  SQLIfStatement_Else_ptr elseItem;

  MySqlCaseStatement();
  SHAREDOBJECT(MySqlCaseStatement);

  SQLExpr_ptr getCondition();

  void setCondition(SQLExpr_ptr condition);

  MySqlCaseStatement_MySqlWhenStatement_list_ptr getWhenList();

  void setWhenList(MySqlCaseStatement_MySqlWhenStatement_list_ptr whenList);

  void addWhenStatement(MySqlCaseStatement_MySqlWhenStatement_ptr stmt);

  SQLIfStatement_Else_ptr getElseItem();

  void setElseItem(SQLIfStatement_Else_ptr elseItem);

  // @Override
  void accept0(MySqlASTVisitor_ptr visitor);

  // @Override
  SQLObject_list_ptr getChildren();

  virtual string_ptr getClass() { return make_string_ptr("MySqlCaseStatement"); }
};
